package com.springboot.file.exception;

import lombok.Getter;
import lombok.Setter;
import java.io.Serial;

/**
 * 业务异常类
 * 用于表示业务逻辑错误
 */
@Setter
@Getter
public class BusinessException extends RuntimeException {
    
    @Serial
    private static final long serialVersionUID = 1L;
    
    /**
     * 错误码
     */
    private final Integer code;
    
    /**
     * 构造函数
     * 
     * @param message 错误消息
     */
    public BusinessException(String message) {
        super(message);
        this.code = 400;
    }
    
    /**
     * 构造函数
     * 
     * @param code 错误码
     * @param message 错误消息
     */
    public BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
    }

}